-- CALC_PT_BUY_COMPENSATE_GEM

-- 计算pt购买补偿钻石
-- @param goodsId 商品id
return function(goodsId)
    -- 获取最近一次使用的货币码
    local currency = ME.user.dbase:query("currency");
    if not currency then
        return 0;
    end

    -- 各种币种的补偿
    local gems = {
        [10001] = { ["TWD"] = 0,   ["THB"] = 0,   ["MYR"] = 0, },
        [10007] = { ["TWD"] = 0,   ["THB"] = 3,   ["MYR"] = 3, },
        [10002] = { ["TWD"] = 12,  ["THB"] = 4,   ["MYR"] = 0, },
        [10005] = { ["TWD"] = 20,  ["THB"] = 11,  ["MYR"] = 6, },
        [10006] = { ["TWD"] = 70,  ["THB"] = 38,  ["MYR"] = 0, },
        [10008] = { ["TWD"] = 120, ["THB"] = 110, ["MYR"] = 0, },
    };

    local map = gems[goodsId];
    if map and type(map[currency]) == "number" then
        return map[currency];
    end

    return 0;
end
